package template;
import java.lang.reflect.Field;
public class MyMessage<T extends Number> {
    private T message;
    public T getMessage() {
        return message;
    }
    public void setMessage(T message) {
        this.message = message;
    }
    public static void main(String[] args) throws NoSuchFieldException {
        MyMessage<Integer> message1 = new MyMessage<>();
        MyMessage<Double> message2 = new MyMessage<>();
        Class cls1 = message1.getClass();
        Class cls2 = message2.getClass();
        System.out.println(cls1 == cls2);
        Field field1 = cls1.getDeclaredField("message");
        Field field2 = cls2.getDeclaredField("message");
        System.out.println(field1.getType());
        System.out.println(field2.getType());
    }
//    public static void fun(MyMessage<? super String> message) {
//        message.setMessage("123");
//        System.out.println(message.getMessage());
//    }
}